package com.shelpe.services.sinbad.service.simbaproxy;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name="${feign.simba.name}", url="${feign.simba.url}")
@RequestMapping(value = "/simba")
public interface SimbaProxy {
	
	/**
	 * 设置一批关键词的出价
	 * @param nick
	 * @param jsonString
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET, value = "/taobao.simba.keywords.pricevon.set")
	public String setPricevon(@RequestParam("nick")String nick, @RequestParam("keywordid_prices")String jsonString);
	
	/**
	 * 取得一个推广组的所有关键词
	 * @param nick
	 * @param adgroupId
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET, value = "/taobao.simba.keywordsbyadgroupid.get")
	public Object getKeywords(@RequestParam("nick")String nick, @RequestParam("adgroup_id")Long adgroupId);
	
	/**
	 * 创建一批关键词
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET, value = "/taobao.simba.keywordsvon.add")
	public Object addKetwords(@RequestParam("nick") String nick, @RequestParam("adgroup_id") Long adgroupId, @RequestParam("keyword_prices") String keywordPrices);
	
	@RequestMapping(method = RequestMethod.GET, value = "/taobao.simba.keywords.delete")
	public Object delKeywords(@RequestParam("nick") String nick, @RequestParam("campaign_id") Long campaignId, @RequestParam("keyword_ids") Long[] keywordIds);

	/*@Service
	@Slf4j
	public static class SimbaProxyFallback implements SimbaProxy{
		@Override
		public String setPricevon(String nick, String jsonString) {
			log.error("setPricevon nick:{} jsonString:{}", nick, jsonString);
			return "setPricevon";
		}

		@Override
		public Object getKeywords(String nick, Long adgroupId) {
			log.error("getKeywords nick:{} adgroupId:{}", nick, adgroupId);
			return "getKeywords";
		}

		@Override
		public Object addKetwords(String nick, Long adgroupId, String keywordPrices) {
			log.error("addKetwords nick:{} adgroupId:{}  adgroupId:{} keywordPrices:{}", nick, adgroupId, keywordPrices);
			return "addKetwords";
		}

		@Override
		public Object delKeywords(String nick, Long campaignId, Long[] keywordIds) {
			log.error("setPricevon nick:{} campaignId:{} keywordIds.toString:{}", nick, campaignId, keywordIds.toString());
			return "delKetwords";
		}
		
	}*/
}